Title: SQL W3S (By-BKK) / 009 NOT
Tags: Obsidian_to_Anki

Q: What does the NOT operator do in SQL?
A: Returns the opposite result of another operator

Q: How do you exclude customers from Spain?
A: SELECT * FROM Customers WHERE NOT Country='Spain'

Q: True/False: NOT can be combined with other operators in SQL
A: True

Q: What is the SQL syntax for NOT with WHERE clause?
A: SELECT column1 FROM table_name WHERE NOT condition

Q: How do you select customers whose names do not start with 'A'?
A: SELECT * FROM Customers WHERE CustomerName NOT LIKE 'A%'

Q: Which operator finds customers with ID not between 10 and 60?
A: NOT BETWEEN

Q: Write a query to select customers that are not from Paris or London
A: SELECT * FROM Customers WHERE City NOT IN ('Paris','London')

Q: How do you select IDs that are not greater than 50?
A: SELECT * FROM Customers WHERE NOT CustomerID > 50

Q: How do you select IDs that are not less than 50?
A: SELECT * FROM Customers WHERE NOT CustomerID < 50

Q: What is the primary purpose of SQL NOT?
A: To filter records that do not match a specified condition

Q: Returns the opposite result of another operator
A: What does the NOT operator do in SQL?

Q: True
A: Can NOT be combined with other operators in SQL?

Q: SELECT * FROM Customers WHERE NOT Country='Spain'
A: How do you exclude customers from Spain?

Q: NOT BETWEEN
A: Which operator finds customers with ID not between 10 and 60?